// main.js
import Vue from 'vue';
import App from './App.vue';
import './registerServiceWorker';
import router from './router';
import './assets/css/global.css';
import './assets/css/reset.css';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios';
import Cookies from 'js-cookie';
import vueshowpdf from 'vueshowpdf';
import './assets/icon/iconfont.css'

Vue.config.productionTip = false;

Vue.use(ElementUI);

axios.defaults.baseURL = 'http://localhost:9087';
Vue.prototype.$axios = axios;
Vue.prototype.$cookies = Cookies;
Vue.prototype.vueshowpdf = vueshowpdf;

axios.interceptors.request.use((config) => {
  let token = Cookies.get('token');
  if (token) {
    config.headers['token'] = token;
    document.cookie = `user=${token}`;
  }
  return config;
});

new Vue({
  router,
  render: (h) => h(App),
}).$mount('#app');


